<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
		integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<title></title>
	<style>
		body{
			padding-bottom: 1000px;
		}
	</style>
</head>

<body>
	<div class="container">
		<div class="row mt-5">
			<div class="col">
				<ul class="list-group">
					<li class="list-group-item">red</li>
					<li class="list-group-item active">green</li>
					<li class="list-group-item">blue</li>
					<li class="list-group-item disabled">yellow</li>
					<li class="list-group-item">pink</li>
				</ul>
			</div>
			<div class="col">
				<div class="list-group">
					<a href="#" class="list-group-item list-group-item-action">red</a>
					<a href="#" class="list-group-item list-group-item-action active">green</a>
					<a href="#" class="list-group-item list-group-item-action">blue</a>
					<button class="list-group-item list-group-item-action" disabled>yellow</button>
					<button class="list-group-item list-group-item-action">pink</button>
				</div>
			</div>
			<div class="col">
				<ul class="list-group list-group-flush">
					<li class="list-group-item">red</li>
					<li class="list-group-item">green</li>
					<li class="list-group-item">blue</li>
					<li class="list-group-item">yellow</li>
					<li class="list-group-item">pink</li>
				</ul>
			</div>
		</div>

		<!-- 添加背景色 -->
		<div class="row mt-5">
			<div class="col">
				<ul class="list-group">
					<li class="list-group-item list-group-item-primary">添加背景色</li>
					<li class="list-group-item list-group-item-secondary">添加背景色</li>
					<li class="list-group-item list-group-item-success">添加背景色</li>
					<li class="list-group-item list-group-item-danger">添加背景色</li>
					<li class="list-group-item list-group-item-warning">添加背景色</li>
					<li class="list-group-item list-group-item-info">添加背景色</li>
					<li class="list-group-item list-group-item-light">添加背景色</li>
					<li class="list-group-item list-group-item-dark">添加背景色</li>
				</ul>
			</div>
			<div class="col">
				<ul class="list-group">
					<li class="list-group-item list-group-item-action list-group-item-primary">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-secondary">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-success">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-danger">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-warning">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-info">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-light">有hover状态的</li>
					<li class="list-group-item list-group-item-action list-group-item-dark">有hover状态的</li>
				</ul>
			</div>
		</div>

		<!-- 使用徽章 -->
		<div class="row mt-5">
			<div class="col">
				<ul class="list-group">
					<li class="list-group-item d-flex justify-content-between align-items-center">
						red
						<span class="badge badge-primary badge-pill">14</span>
					</li>
					<li class="list-group-item d-flex justify-content-between align-items-center">
						green
						<span class="badge badge-success badge-pill">5</span>
					</li>
					<li class="list-group-item d-flex justify-content-between align-items-center">
						blue
						<span class="badge badge-danger badge-pill">1</span>
					</li>
				</ul>
			</div>
		</div>
		
		<!-- 自定义内容 -->
		<div class="row mt-5">
			<div class="col">
				<div class="list-group">
					<a href="#" class="list-group-item list-group-item-action active">
						<div class="d-flex justify-content-between">
							<h5 class="mb-1">List group item heading</h5>
							<small>3 days ago</small>
						</div>
						<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    					<small>Donec id elit non mi porta.</small>
					</a>
					<a href="#" class="list-group-item list-group-item-action">
						<div class="d-flex justify-content-between">
							<h5 class="mb-1">List group item heading</h5>
							<small>3 days ago</small>
						</div>
						<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    					<small>Donec id elit non mi porta.</small>
					</a>
					<a href="#" class="list-group-item list-group-item-action">
						<div class="d-flex justify-content-between">
							<h5 class="mb-1">List group item heading</h5>
							<small>3 days ago</small>
						</div>
						<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
    					<small>Donec id elit non mi porta.</small>
					</a>
				</div>
			</div>
		</div>

		<!-- 选项卡 -->
		<div class="row mt-5">
			<div class="col-4">
				<div class="list-group">
					<a href="#list-home" class="list-group-item list-group-item-action active" data-toggle="list">Home</a>
					<a href="#list-profile" class="list-group-item list-group-item-action" data-toggle="list">Profile</a>
					<a href="#list-messages" class="list-group-item list-group-item-action" data-toggle="list">Messages</a>
					<span data-target="#list-settings" class="list-group-item list-group-item-action" data-toggle="list">Settings</span>
				</div>
			</div>
			<div class="col-8">
				<div class="tab-content">
					<div class="tab-pane fade show active" id="list-home">Velit aute mollit ipsum ad dolor consectetur nulla officia culpa adipisicing exercitation fugiat tempor. Voluptate deserunt sit sunt nisi aliqua fugiat proident ea ut. Mollit voluptate reprehenderit occaecat nisi ad non minim tempor sunt voluptate consectetur exercitation id ut nulla. Ea et fugiat aliquip nostrud sunt incididunt consectetur culpa aliquip eiusmod dolor. Anim ad Lorem aliqua in cupidatat nisi enim eu nostrud do aliquip veniam minim.</div>
					<div class="tab-pane fade" id="list-profile">Cupidatat quis ad sint excepteur laborum in esse qui. Et excepteur consectetur ex nisi eu do cillum ad laborum. Mollit et eu officia dolore sunt Lorem culpa qui commodo velit ex amet id ex. Officia anim incididunt laboris deserunt anim aute dolor incididunt veniam aute dolore do exercitation. Dolor nisi culpa ex ad irure in elit eu dolore. Ad laboris ipsum reprehenderit irure non commodo enim culpa commodo veniam incididunt veniam ad.</div>
					<div class="tab-pane fade" id="list-messages">Ut ut do pariatur aliquip aliqua aliquip exercitation do nostrud commodo reprehenderit aute ipsum voluptate. Irure Lorem et laboris nostrud amet cupidatat cupidatat anim do ut velit mollit consequat enim tempor. Consectetur est minim nostrud nostrud consectetur irure labore voluptate irure. Ipsum id Lorem sit sint voluptate est pariatur eu ad cupidatat et deserunt culpa sit eiusmod deserunt. Consectetur et fugiat anim do eiusmod aliquip nulla laborum elit adipisicing pariatur cillum.</div>
					<div class="tab-pane fade" id="list-settings">Irure enim occaecat labore sit qui aliquip reprehenderit amet velit. Deserunt ullamco ex elit nostrud ut dolore nisi officia magna sit occaecat laboris sunt dolor. Nisi eu minim cillum occaecat aute est cupidatat aliqua labore aute occaecat ea aliquip sunt amet. Aute mollit dolor ut exercitation irure commodo non amet consectetur quis amet culpa. Quis ullamco nisi amet qui aute irure eu. Magna labore dolor quis ex labore id nostrud deserunt dolor eiusmod eu pariatur culpa mollit in irure.</div>
				</div>
			</div>
		</div>

		<!-- 方法与事件 -->
		<div class="row mt-5">
			<div class="col-4">
				<div class="list-group" id="myList">
					<a href="#list-home1" class="list-group-item list-group-item-action">Home</a>
					<a href="#list-profile1" class="list-group-item list-group-item-action" >Profile</a>
					<a href="#list-messages1" class="list-group-item list-group-item-action">Messages</a>
					<a href="#list-settings1" class="list-group-item list-group-item-action">Settings</a>
				</div>
			</div>
			<div class="col-8">
				<div class="tab-content">
					<div class="tab-pane fade show active" id="list-home1">Velit aute mollit ipsum ad dolor consectetur nulla officia culpa adipisicing exercitation fugiat tempor. Voluptate deserunt sit sunt nisi aliqua fugiat proident ea ut. Mollit voluptate reprehenderit occaecat nisi ad non minim tempor sunt voluptate consectetur exercitation id ut nulla. Ea et fugiat aliquip nostrud sunt incididunt consectetur culpa aliquip eiusmod dolor. Anim ad Lorem aliqua in cupidatat nisi enim eu nostrud do aliquip veniam minim.</div>
					<div class="tab-pane fade" id="list-profile1">Cupidatat quis ad sint excepteur laborum in esse qui. Et excepteur consectetur ex nisi eu do cillum ad laborum. Mollit et eu officia dolore sunt Lorem culpa qui commodo velit ex amet id ex. Officia anim incididunt laboris deserunt anim aute dolor incididunt veniam aute dolore do exercitation. Dolor nisi culpa ex ad irure in elit eu dolore. Ad laboris ipsum reprehenderit irure non commodo enim culpa commodo veniam incididunt veniam ad.</div>
					<div class="tab-pane fade" id="list-messages1">Ut ut do pariatur aliquip aliqua aliquip exercitation do nostrud commodo reprehenderit aute ipsum voluptate. Irure Lorem et laboris nostrud amet cupidatat cupidatat anim do ut velit mollit consequat enim tempor. Consectetur est minim nostrud nostrud consectetur irure labore voluptate irure. Ipsum id Lorem sit sint voluptate est pariatur eu ad cupidatat et deserunt culpa sit eiusmod deserunt. Consectetur et fugiat anim do eiusmod aliquip nulla laborum elit adipisicing pariatur cillum.</div>
					<div class="tab-pane fade" id="list-settings1">Irure enim occaecat labore sit qui aliquip reprehenderit amet velit. Deserunt ullamco ex elit nostrud ut dolore nisi officia magna sit occaecat laboris sunt dolor. Nisi eu minim cillum occaecat aute est cupidatat aliqua labore aute occaecat ea aliquip sunt amet. Aute mollit dolor ut exercitation irure commodo non amet consectetur quis amet culpa. Quis ullamco nisi amet qui aute irure eu. Magna labore dolor quis ex labore id nostrud deserunt dolor eiusmod eu pariatur culpa mollit in irure.</div>
				</div>
			</div>
		</div>
	</div>

	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
		integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
		crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
		integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
		crossorigin="anonymous"></script>

	<script>
		//方法
		$('#myList a:first-child').tab('show');		//修改当前选中项

		$('#myList a').on('click',function(){
			$(this).tab('show');
		});

		//事件
		$('#myList a:nth-child(2)').on('show.bs.tab', function (e) {
			console.log('该内容要显示了');	//显示前的事件
		});
		$('#myList a:nth-child(2)').on('shown.bs.tab', function (e) {
			console.log('该内容已经显示了');	//显示后的事件
		});

		
		$('#myList a:nth-child(2)').on('hide.bs.tab', function (e) {
			console.log('该内容要隐藏了');	//隐藏前的事件
		});
		$('#myList a:nth-child(2)').on('hidden.bs.tab', function (e) {
			console.log('该内容已经隐藏了');	//隐藏后的事件
		});
	</script>	
</body>

</html>
